/**   
 * @Title: CollectionCopyable.java 
 * CopyRight(c)2010-DMX 
 */
package com.dmx.fw.component.util;

import java.util.Collection;
import java.util.Map;

/** 
 * @Description: CollectionCopyable
 * @author: system
 * @date: 2006
 * @version V1.0 
 * 
 */
public class CollectionCopyable implements CopyableInterface {

	/**
	 * @Description 实现接口，判断集合
	 * @param propertyName: 
	 * @param propertyValue: 属性值
	 * @param clazz: 类名
	 * @return boolean
	 */
	public boolean isCopyable(String propertyName, Object propertyValue,
			Class clazz) {
		if(propertyValue==null) return true;
		if(Map.class.isAssignableFrom(propertyValue.getClass()) ){
			return ((Map)propertyValue).size()>0;
		}else if(Collection.class.isAssignableFrom(propertyValue.getClass())){
			return ((Collection)propertyValue).size()>0;
		}else if(propertyValue.getClass().isArray()){
			return ((Object[])propertyValue).length>0;
		}
		return true;
	}

}
